package com.dingding.service.activity.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dingding.common.core.beans.ActivityRelevance;
import com.dingding.facde.activity.service.IActivityShareFacade;
import com.dingding.service.activity.core.dao.IActivityShareDao;

/**
 * @ClassName: UserActivityFacadeImpl 
 * @Description: 用户活动分享信息
 * @author cw
 * @date 2016年5月12日 上午11:18:22
 */
@Component("userActivityService")
public class UserActivityFacadeImpl implements IActivityShareFacade {
	
	
	@Resource(name = "activitySharDao")
	private IActivityShareDao activityShareDao;

	/**
	 * 
	 * @Title: isExistUserByUserName 
	 * @Description: 判断该用户活动下面的邀请码是否存在
	 * @param invitationCode 用户邀请码
	 * @return int 1: 邀请码 可以使用  2: 邀请码 已经使用  3:邀请码 不能为空
	 * @author cw
	 * 
	 */
	@Override
	public int isExistInvitationCode(String invitationCode) {
		return activityShareDao.isExistInvitationCode(invitationCode);
	}

	/**
	 * 
	 * @Title: getUserActivityByProperty 
	 * @Description: 根据某一属性查询用户活动表相关信息
	 * @param property 属性
	 * @param value 属性值
	 * @return  UserLogin 查询到的用户活动信息
	 * @author cw
	 * 
	 */
	@Override
	public ActivityRelevance getUserActivityByProperty(String property, String value) {
		return activityShareDao.getUserActivityByProperty(property, value);
	}

	/**
	 * 
	 * @Title: getUserActiveInfo 
	 * @Description: 获取用户活动信息
	 * @param 	userId 用户id
	 * 			activityId	活动id 
	 * @return  用户活动信息
	 * @author cw
	 * 
	 */
	@Override
	public ActivityRelevance getUserActiveInfo(String userId, String activityId) {
		return activityShareDao.getUserActiveInfo(userId, activityId);
	}

	/**
	 * 
	 * @Title: addUserActivity
	 * @Description: 添加用户活动关联信息
	 * @param userActivity
	 *            用户活动
	 * @author cw
	 * @return 
	 */
	@Override
	public boolean addUserActivity(String userId, String activityId) {
		return activityShareDao.addUserActivity(userId, activityId);
	}

	/**
	 * 
	 * @Title: setUserActivityNumber
	 * @Description: 修改用户统计次数
	 * @param userId	用户Id
	 *        activityId    活动Id
	 * @author cw
	 * 
	 */
	@Override
	public boolean setUserActivityNumber(String userId, String activityId) {
		return activityShareDao.setUserActivityNumber(userId, activityId);
	}
	
	/**
	 * 
	 * @Title: setActivityRelevanceState
	 * @Description: 修改用户是否已经参与过活动的状态
	 * @param userId	用户Id
	 *        activityId    活动Id
	 * @author cw
	 * 
	 */
	public boolean setActivityRelevanceState(String userId, String activityId){
		return activityShareDao.setActivityRelevanceState(userId, activityId);
	}
	
}
